package com.lksoft.bz;

import java.awt.Color;
import java.util.HashMap;


/**
 * Hash map of static color objects
 * 
 * @author lake
 *
 */
public class ColorMap {
	private static HashMap<Integer, Color> colorMap = new HashMap<Integer, Color>();
	
	/**
	 * Gets a static color object from its rgb
	 * 
	 * @param rgb
	 * @return
	 */
	public static Color getColor(int rgb){
		Color color = colorMap.get(rgb);
		if( color == null ){
			color = new Color(rgb);
			colorMap.put(rgb, color);
		}
		
		return color;
	}
}
